import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {TabsPage} from './tabs.page';

const routes: Routes = [
    {
        path: 'tabs',
        component: TabsPage,
        children: [
            {
                path: 'home',
                children: [
                    {
                        path: '',
                        loadChildren: () => import('../home/home.module').then(m => m.HomeModule),
                        data: {title: '首页'}
                    },
                    {
                        path: 'threeDimensional',
                        loadChildren: () => import('../application/three-dimensional/three-dimensional.module').then(m => m.ThreeDimensionalPageModule),
                        // loadChildren: () => import('../three-dimensional/three-dimensional.module').then(m => m.ThreeDimensionalPageModule),
                        data: {title: '产品秀（3维）'}
                    },
                ],

            },
            {
                path: 'mall',
                loadChildren: () => import('../mall/mall.module').then(m => m.MallPageModule),
                data: {title: '商城'}
            },
            {
                path: 'application',
                loadChildren: () => import('../application/application.module').then(m => m.ApplicationPageModule),
                data: {title: '应用'}
            },
            {
                path: 'partner',
                loadChildren: () => import('../partner/partner.module').then(m => m.PartnerPageModule),
                data: {title: '伙伴'}
            },
            {
                path: 'profile',
                loadChildren: () => import('../profile/profile.module').then(m => m.ProfileModule)
            },
            {
                path: 'tab2',
                loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
            },
            {
                path: 'tab3',
                loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
            },

            {
                path: '',
                redirectTo: '/tabs/home',
                pathMatch: 'full'
            }
        ]
    },
    {
        path: '',
        redirectTo: '/tabs/home',
        pathMatch: 'full'
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class TabsPageRoutingModule {
}
